package com.bolt.report.definition;

import com.bolt.common.collection.IteratorUtil;
import com.bolt.common.utils.StrUtil;

import java.io.Serializable;
import java.util.List;

public class GroupDefinition implements Serializable {

    private List<String> desc;

    private StyleDefinition style;

    private List<CellDefinition> groups;

    private List<CellDefinition> calculate;

    public List<String> getDesc() {
        return desc;
    }

    public String getDesc(int index) {
        if (IteratorUtil.isNotEmpty(this.desc) && desc.size() > index) {
            return this.desc.get(index);
        } else {
            return StrUtil.EMPTY;
        }
    }

    public void setDesc(List<String> desc) {
        this.desc = desc;
    }

    public List<CellDefinition> getGroups() {
        return groups;
    }

    public void setGroups(List<CellDefinition> groups) {
        this.groups = groups;
    }

    public List<CellDefinition> getCalculate() {
        return calculate;
    }

    public void setCalculate(List<CellDefinition> calculate) {
        this.calculate = calculate;
    }

    public StyleDefinition getStyle() {
        return style;
    }

    public void setStyle(StyleDefinition style) {
        this.style = style;
    }
}